<?php
$title = 'Bill Stream';
?>
<?php require('inc-header.php'); ?>

<script type="text/javascript" src="/js/contentflow/contentflow.js" load="stack"></script>
<script type="text/javascript">
    var BillStreamFlow = new ContentFlow('BillStream', { circularFlow: false, startItem:0, visibleItems:7, reflectionHeight:0 } ) ;
</script>
<p><?php echo $message; ?></p>

<?php if (count($bills) > 0): ?>


    <!-- Start Content Flow Section -->
    <div id="BillStream" class="ContentFlow">
        <div class="loadIndicator"><div class="indicator"></div></div>
        <div class="flow">
            <?php foreach ($bills as $bill): ?>
                <div class="item" style="background:white;border:10px solid <?php echo $bill->color ?>;padding:25px;">
                    <div class="content">
                        <h2><?php echo $bill->name; ?></h2>
                        <h3>$<?php echo $bill->amount; ?></h3>
                        <?php echo $bill->due_date->format("l m/d/Y"); ?><br />
                        <?php if ($bill->days_till_due == 0): ?>
                            Due Today<br />
                        <?php else: ?>
                            Due in <?php echo $bill->days_till_due; ?> Days<br />
                        <?php endif; ?>
                        <div style="text-align:right;">
                            <?php echo anchor('billstream/edit?id=' . $bill->id, 'Edit'); ?>
                        </div>
                    </div>
                </div>
            <?php endforeach; ?>
        </div>
        <div class="globalCaption"></div>
        <div class="scrollbar"><div class="slider"><div class="position"></div></div></div>
    </div>
    <!-- End Content Flow Section -->

<?php else: ?>

    <h3>There are no bills. <?php echo anchor('billstream/add', 'Add some billers!'); ?></h3>

<?php endif; ?>

<div style="text-align:right;">
    <?php echo anchor('billstream/add', 'Add'); ?>
</div>
<?php require('inc-footer.php'); ?>